package uk.co.droidinactu.inlibrislibertas.model;

public final class BooleanOperatorFactory {

	public static BooleanOperator getBooleanOperator(final String str) {
		if (str.equalsIgnoreCase("AND")) {
			return BooleanOperator.AND;
		}
		if (str.equalsIgnoreCase("ANDNOT")) {
			return BooleanOperator.ANDNOT;
		}
		if (str.equalsIgnoreCase("ORNOT")) {
			return BooleanOperator.ORNOT;
		}
		return BooleanOperator.OR;
	}

	public static boolean isBooleanOperator(final String str) {
		if (str.equalsIgnoreCase("AND")) {
			return true;
		}
		if (str.equalsIgnoreCase("ANDNOT")) {
			return true;
		}
		if (str.equalsIgnoreCase("ORNOT")) {
			return true;
		}
		if (str.equalsIgnoreCase("OR")) {
			return true;
		}
		return false;
	}

}
